import ContextMenu from "@imengyu/vue3-context-menu";
import { MenuItem } from "@imengyu/vue3-context-menu/lib/ContextMenuDefine";

export default function (e: MouseEvent, items?: MenuItem[], showFlag = true) {
  if (!showFlag) return;
  e.preventDefault();
  if (!items) return;
  ContextMenu.showContextMenu({
    x: e.x,
    y: e.y,
    items: items,
  });
}
